package com.freak.wanandroid.base.lifecycle;

import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.LifecycleOwner;

public class BaseGenericLifecycleObserver implements LifecycleEventObserver {

    @Override
    public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
        switch (event) {
            case ON_CREATE:
//                LogUtil.e( "Fragment 生命周期 Observer【onCreate】");
                break;
            case ON_START:
//                LogUtil.e( "Fragment 生命周期  Observer【onStart】");
                break;
            case ON_RESUME:
//                LogUtil.e( "Fragment 生命周期  Observer【onResume】" + source.getLifecycle().getClass().getSimpleName());
                break;
            case ON_PAUSE:
//                LogUtil.e( "Fragment 生命周期  Observer【onPause】");
                break;
            case ON_STOP:
//                LogUtil.e( "Fragment 生命周期  Observer【onStop】");
                break;
            case ON_DESTROY:
//                LogUtil.e( "Fragment 生命周期  Observer【onDestroy】");
                break;
            case ON_ANY:
//                LogUtil.e( "Fragment 生命周期  Observer onAny");
                break;
            default:
//                LogUtil.e( "Fragment 生命周期  Observer【不存在的事件】");
                break;
        }
    }
}